<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 接收用户输入的数字 -->
    <script>
        const num = prompt("请输入一个数字：");
    //定义绘制图形的函数
        function drawShapes(num){
    //绘制三角形
        let tri ="";
        for ( let i =1; i <= num ; i ++){
        tri +="*".repeat(i)+"\n";
        }
        console.log(tri);
    //绘制平行四边形
        let para="";
        for(leti=1;i<=num;i++){
        para+="".repeat(num-i)+"*".repeat(num)+"\n";
        }
        console.log(para);
    }
    //调用函数，输出对应的三角形和平行四边形
       drawShapes(num);
</script>
</body>
</html>